<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  

  
  <title>小匠云平台物联网开发套件iotkit（Android）使用手册 | Hexo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="小匠云平台物联网开发套件iotkit（Android）使用手册在项目中添加依赖1234567implementation &apos;com.google.protobuf:protobuf-lite:3.0.0&apos;implementation &apos;org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0&apos;implementation &apos;org.eclipse.">
<meta property="og:type" content="article">
<meta property="og:title" content="小匠云平台物联网开发套件iotkit（Android）使用手册">
<meta property="og:url" content="http://yoursite.com/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="小匠云平台物联网开发套件iotkit（Android）使用手册在项目中添加依赖1234567implementation &apos;com.google.protobuf:protobuf-lite:3.0.0&apos;implementation &apos;org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0&apos;implementation &apos;org.eclipse.">
<meta property="og:locale" content="中文">
<meta property="og:updated_time" content="2019-04-11T10:12:15.757Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="小匠云平台物联网开发套件iotkit（Android）使用手册">
<meta name="twitter:description" content="小匠云平台物联网开发套件iotkit（Android）使用手册在项目中添加依赖1234567implementation &apos;com.google.protobuf:protobuf-lite:3.0.0&apos;implementation &apos;org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0&apos;implementation &apos;org.eclipse.">
  
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  <link rel="stylesheet" href="/css/style.css">
</head>
</html>
<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-小匠云平台物联网开发套件iotkit（Android）使用手册" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/" class="article-date">
  <time datetime="2019-04-11T10:09:49.000Z" itemprop="datePublished">2019-04-11</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      小匠云平台物联网开发套件iotkit（Android）使用手册
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="小匠云平台物联网开发套件iotkit（Android）使用手册"><a href="#小匠云平台物联网开发套件iotkit（Android）使用手册" class="headerlink" title="小匠云平台物联网开发套件iotkit（Android）使用手册"></a>小匠云平台物联网开发套件iotkit（Android）使用手册</h2><h3 id="在项目中添加依赖"><a href="#在项目中添加依赖" class="headerlink" title="在项目中添加依赖"></a>在项目中添加依赖</h3><figure class="highlight groovy"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">implementation <span class="string">'com.google.protobuf:protobuf-lite:3.0.0'</span></span><br><span class="line">implementation <span class="string">'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'</span></span><br><span class="line">implementation <span class="string">'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'</span></span><br><span class="line">implementation <span class="string">'com.squareup.retrofit2:retrofit:2.5.0'</span></span><br><span class="line">implementation <span class="string">'com.squareup.retrofit2:converter-gson:2.5.0'</span></span><br><span class="line">implementation <span class="string">'com.squareup.okhttp3:logging-interceptor:3.12.0'</span></span><br><span class="line">implementation <span class="string">'io.fogcloud.sdk:easylinkv3:0.2.6'</span></span><br></pre></td></tr></table></figure>
<h3 id="在AndroidManifest-xml中配置"><a href="#在AndroidManifest-xml中配置" class="headerlink" title="在AndroidManifest.xml中配置"></a>在AndroidManifest.xml中配置</h3><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">&lt;!-- Mqtt Service --&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">service</span> <span class="attr">android:name</span>=<span class="string">"org.eclipse.paho.android.service.MqttService"</span>/&gt;</span></span><br><span class="line"><span class="comment">&lt;!-- 需要的权限 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_WIFI_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_COARSE_LOCATION"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_FINE_LOCATION"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.INTERNET"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.CHANGE_WIFI_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.CHANGE_WIFI_MULTICAST_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.ACCESS_NETWORK_STATE"</span> /&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">uses-permission</span> <span class="attr">android:name</span>=<span class="string">"android.permission.WAKE_LOCK"</span> /&gt;</span></span><br></pre></td></tr></table></figure>
<h3 id="在Application-onCreate-中调用初始化"><a href="#在Application-onCreate-中调用初始化" class="headerlink" title="在Application onCreate()中调用初始化"></a>在Application onCreate()中调用初始化</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//初始化SDK</span></span><br><span class="line">IotKit.init(<span class="keyword">this</span>, <span class="string">"appSource"</span>, <span class="string">"developKey"</span>, <span class="string">"developSecret"</span>);</span><br><span class="line"><span class="comment">//是否打印日志，默认打开</span></span><br><span class="line">IotKit.isLoggable = <span class="keyword">false</span>;</span><br><span class="line"><span class="comment">//是否连接测试服务器，默认连接正式服务器</span></span><br><span class="line">IotKit.isTestServer = <span class="keyword">false</span>;</span><br></pre></td></tr></table></figure>
<h3 id="登陆小匠云服务"><a href="#登陆小匠云服务" class="headerlink" title="登陆小匠云服务"></a>登陆小匠云服务</h3><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//登陆小匠云服务，userId 小匠云注册用户id，在登陆成功后才可以使用小匠云服务。</span></span><br><span class="line"><span class="comment">//需要第三方服务器对接小匠云用户中心，见服务端文档</span></span><br><span class="line">XJAccountManager.getInstance().login(String userId, AccountCallback callback);</span><br><span class="line"><span class="comment">//在注销或退出APP时需要退出小匠云服务</span></span><br><span class="line">XJAccountManager.getInstance().logout();</span><br></pre></td></tr></table></figure>
<h3 id="设备配网"><a href="#设备配网" class="headerlink" title="设备配网"></a>设备配网</h3><p>设备配网成功后获取到deviceId,调用绑定设备接口绑定设备，即可在设备列表接口获取到已绑定的设备。</p>
<blockquote>
<p>设备配网只支持2.4G wifi。</p>
</blockquote>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//开始配网</span></span><br><span class="line">XJWifiConfigManager.getInstance().startWifiConfig(<span class="keyword">this</span>, WifiConfigInfo, <span class="number">60</span>*<span class="number">1000</span>, <span class="keyword">new</span> WifiJoinCallback() &#123;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onDeviceConnected</span><span class="params">()</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备联网成功</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onJoinSucceed</span><span class="params">(String deviceId)</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备小匠云验证成功</span></span><br><span class="line">            &#125;</span><br><span class="line">            <span class="meta">@Override</span></span><br><span class="line">            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onJoinFailed</span><span class="params">(String code, String errorMsg)</span> </span>&#123;</span><br><span class="line">                <span class="comment">//设备配网失败</span></span><br><span class="line">            &#125;</span><br><span class="line">        &#125;);</span><br><span class="line"><span class="comment">//停止配网</span></span><br><span class="line">XJWifiConfigManager.getInstance().stopWifiConfig();</span><br></pre></td></tr></table></figure>
<h3 id="小匠云API管理类XJApiManager，管理设备相关的http服务"><a href="#小匠云API管理类XJApiManager，管理设备相关的http服务" class="headerlink" title="小匠云API管理类XJApiManager，管理设备相关的http服务"></a>小匠云API管理类XJApiManager，管理设备相关的http服务</h3><p>示例：获取支持的产品列表</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">XJApiManager.getInstance().productList(<span class="keyword">new</span> ApiCallback&lt;List&lt;Product&gt;&gt;() &#123;</span><br><span class="line">                  <span class="meta">@Override</span></span><br><span class="line">                  <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onSuccess</span><span class="params">(List&lt;Product&gt; response)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                  &#125;</span><br><span class="line">                  <span class="meta">@Override</span></span><br><span class="line">                  <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onError</span><span class="params">(<span class="keyword">int</span> code, String msg)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                  &#125;</span><br><span class="line">              &#125;);</span><br></pre></td></tr></table></figure>
<p>更多：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 修改设备昵称</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceNick</span><span class="params">(String deviceId, String nickname, ApiCallback&lt;DeviceNickRes&gt; callback)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 管理员用户修改绑定设备昵称</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceNickAdmin</span><span class="params">(String deviceId, String nickname, ApiCallback&lt;DeviceNickRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 解绑设备</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceUnbind</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceUnbindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 绑定设备(不设置昵称)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBind</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceBindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 绑定设备(设置昵称)</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBind</span><span class="params">(String productKey, String deviceId, String nickname, ApiCallback&lt;DeviceBindRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备列表</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceList</span><span class="params">(ApiCallback&lt;List&lt;Device&gt;&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备详情</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceInfo</span><span class="params">(String deviceId, ApiCallback&lt;DeviceInfo&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取产品列表</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">productList</span><span class="params">(ApiCallback&lt;List&lt;Product&gt;&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取产品的详细信息</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">productInfo</span><span class="params">(String productKey, ApiCallback&lt;ProductInfo&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 获取设备的绑定用户信息</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceBindUsers</span><span class="params">(String deviceId, ApiCallback&lt;DeviceBindUsers&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 设备分享</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceShareSend</span><span class="params">(String productKey, String deviceId, ApiCallback&lt;DeviceShareSendRes&gt; callBack)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 接收分享的设备</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">deviceShareAccept</span><span class="params">(String qrcode, ApiCallback&lt;DeviceShareAcceptRes&gt; callBack)</span></span>;</span><br></pre></td></tr></table></figure>
<h3 id="小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务"><a href="#小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务" class="headerlink" title="小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务"></a>小匠云设备数据管理类XJDataManager，管理设备相关的长连接通信服务</h3><p>示例：向设备发送开机</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">HashMap&lt;String, String&gt; hashMap = <span class="keyword">new</span> HashMap&lt;String, String&gt;();</span><br><span class="line"><span class="comment">//map key和value见协议文档</span></span><br><span class="line">hashMap.put(<span class="string">"PowerSwitch"</span>, <span class="string">"1"</span>);</span><br><span class="line">XJDataManager.getInstance().sendCmd(<span class="string">"productKey"</span>, <span class="string">"deviceId"</span>, hashMap,</span><br><span class="line">                        <span class="keyword">new</span> ActionCallback() &#123;</span><br><span class="line">                            <span class="meta">@Override</span></span><br><span class="line">                            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onSuccess</span><span class="params">()</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                            &#125;</span><br><span class="line">                            <span class="meta">@Override</span></span><br><span class="line">                            <span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">onFailure</span><span class="params">(String msg)</span> </span>&#123;</span><br><span class="line"></span><br><span class="line">                            &#125;</span><br><span class="line">                        &#125;);</span><br></pre></td></tr></table></figure>
<p>更多：</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">  <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 监听设备实时数据</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">addDataCallback</span><span class="params">(DataCallback dataCallback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 移除设备实时数据监听</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">removeDataCallback</span><span class="params">(DataCallback dataCallback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 移除所有设备实时数据监听</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">removeAllDataCallback</span><span class="params">()</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 蓝牙设备数据上报</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">bleDataPush</span><span class="params">(String productKey, String deviceId, HashMap&lt;String, String&gt; hashMap,</span></span></span><br><span class="line"><span class="function"><span class="params">                  ActionCallback callback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 向设备发送数据</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function"><span class="keyword">void</span> <span class="title">sendCmd</span><span class="params">(String productKey, String deviceId, HashMap&lt;String, String&gt; hashMap,</span></span></span><br><span class="line"><span class="function"><span class="params">              ActionCallback callback)</span></span>;</span><br><span class="line"> <span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 获取设备离线、在线状态</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function">String <span class="title">getOnlineStatus</span><span class="params">(String deviceId)</span></span>;</span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment">  * 获取设备 最新状态</span></span><br><span class="line"><span class="comment">  */</span></span><br><span class="line"> <span class="function">String <span class="title">getLatestStatus</span><span class="params">(String deviceId)</span></span>;</span><br></pre></td></tr></table></figure>

      
    </div>
    <footer class="article-footer">
      <a data-url="http://yoursite.com/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/" data-id="cjujetss500021lrjnv69vk4b" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2019/04/11/开发者账号秘钥验证，并获取token/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Newer</strong>
      <div class="article-nav-title">
        
          开发者账号秘钥验证，并获取token
        
      </div>
    </a>
  
  
    <a href="/2019/03/04/hello-world/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Older</strong>
      <div class="article-nav-title">Hello World</div>
    </a>
  
</nav>

  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/XJIOTKit/">XJIOTKit</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/iOS/">iOS</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/xjiang/">xjiang</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/使用文档/">使用文档</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/XJIOTKit/" style="font-size: 10px;">XJIOTKit</a> <a href="/tags/iOS/" style="font-size: 10px;">iOS</a> <a href="/tags/xjiang/" style="font-size: 10px;">xjiang</a> <a href="/tags/使用文档/" style="font-size: 10px;">使用文档</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/04/">April 2019</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2019/03/">March 2019</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2019/04/12/XJIOTKit-使用/">XJIOTKit 使用</a>
          </li>
        
          <li>
            <a href="/2019/04/11/新用户注册推送到中心/">新用户注册推送到中心</a>
          </li>
        
          <li>
            <a href="/2019/04/11/开发者账号秘钥验证，并获取token/">开发者账号秘钥验证，并获取token</a>
          </li>
        
          <li>
            <a href="/2019/04/11/小匠云平台物联网开发套件iotkit（Android）使用手册/">小匠云平台物联网开发套件iotkit（Android）使用手册</a>
          </li>
        
          <li>
            <a href="/2019/03/04/hello-world/">Hello World</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2019 zt.cfvli<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
  <script src="/fancybox/jquery.fancybox.pack.js"></script>


<script src="/js/script.js"></script>



  </div>
</body>
</html>